Add schema default/fixed value support in DOM#325
Merged
Conversation
Contributor
|
This is pretty nice. I hope I get the time at the weekend to compile PHP 5.5 and test this. I'd say you can squash the four commits into one to polish this a bit. |
Added support for adding fixed/default values during XSD validation and added/updated associated tests
Contributor
Author
|
@hakre Squashed for your compiling pleasure. Also note that this should backport nicely to 5.4 and even 5.3 if you really want. The only stipulation is that you compile against libxml >=2.6.14. |
andypost
added a commit
to skilld-labs/php-src
that referenced
this pull request
Jul 16, 2026
The Boost.Context 1.91.0 sync (phpGH-22584) pulled in boostorg/context#325, "fix cortex-m0 support to aapcs_elf_gas target", which adds a fallback branch to make_fcontext/jump_fcontext for the Thumb-1 encoding limits of ARMv6-M. The branch is correct for Cortex-M0 but is gated on __ARM_ARCH >= 7, which is also false for classic ARMv6 in ARM state (Alpine armhf, Raspberry Pi 1/Zero) -- targets that can encode every instruction in the >= 7 branch and need none of the workaround. Two consequences. make_fcontext took `ldr a2, =finish', materialising the absolute address of finish through a literal pool in .text and emitting R_ARM_ABS32 against .text. In a PIE link that becomes an R_ARM_RELATIVE dynamic relocation inside the read-only text segment, tagging the binary DT_TEXTREL. musl supports DT_TEXTREL only for DSOs it maps itself; the main executable is kernel-mapped and handled by kernel_mapped_dso(), which never inspects it, so ldso writes to a read-only page and dies with SIGSEGV in do_relocs() before main(). Every SAPI, every invocation, no output. glibc masks this by mprotecting the segment writable, which is why only musl builds noticed. Separately, jump_fcontext -- the hot path on every fiber switch -- grew from 13 to 43 instructions on all ARMv6 builds, glibc included. Gate on __ARM_ARCH_6M__ instead, exactly the target php#325 names. The result emits byte-identical .text to 8.6.0alpha1 on every ARM target except Cortex-M0, where it emits byte-identical .text to current master: each target gets back the code it had before the regression, and M0 keeps what php#325 added. armv7 and arm64 are unaffected either way. Zend/asm is vendored and verified by the Verify Bundled Files workflow, so carry the same diff in .github/scripts/download-bundled and re-apply it from the sync script, as uriparser already does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for adding fixed/default values during XSD validation in the DOM extension.
This patch adds a second (optional)
$flagsargument toDOMDocument::schemaValidate()andDOMDocument::schemaValidateSource(), which is a bitmask of libxml schema validation context options. It also defines an additional PHP constant,LIBXML_SCHEMA_CREATE, corresponding to libxml'sXML_SCHEMA_VAL_VC_I_CREATE, which is currently the only valid flag that can be passed. When passed, the schema validation procedure will add default values from the schema when they are unspecified in the document.The default value for the optional
$flagsparameter is0, which results in the current behaviour - hence merging this feature does not cause a BC-break.See http://stackoverflow.com/q/15948847/889949 for more information.